

let app = new Vue({
    el:'#whole',
    data:{
        homepage:'',
        motifid:'',
        name:''
    },
    methods:{
        click:function(value){
            app.motifid = value;
            // console.log(value);
            return false;
        }
    }
});
//动态加载就用这种方法
//删除
$('body').on('click', '.delete', function () {
    let _this = $(this);
    // console.log(app.motifid);
    let motifid = app.motifid;

    $.ajax({
        url: '/index.php?s=api/homepage/homepage_delete',
        type: 'POST',
        data:{
            motifid:motifid
        },
        success:function(value){
            console.log(value);
            if(value.status === 0){
                window.alert(value.message);
                _this.parent().parent().remove();

            }else{
                window.alert(value.message);
            }
        }

    });
    return false;
});

$(document).ready(function(){
    $.ajax({
        url:'/index.php?s=api/homepage/homepage_list',
        type:'POST',
        data: {},
        success:function (value) {

            console.log(value);
            console.log(value.data[0]);
            app.name = value.data[0];
            app.homepage=value.data[1];

        }
    });
});
$('body').on('click','.edit',function(){
    $.ajax({
        url: '/index.php?s=api/edit/edit_list',
        type:'POST',
        data:{
        },
        success:function(value){
            window.location.href = '/index.php?s=index/login/login_list';
        }
    });
});